import cn.edu.dao.BookDao;
import cn.edu.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author Davey chan
 */
public class APP2 {
    public static void main(String[] args) {
//        获取IOC容器:目的是为了解耦
        ApplicationContext ctx=new ClassPathXmlApplicationContext("applicationContext.xml");
//        BookDao bookDao = (BookDao) ctx.getBean("bookDao");
//        bookDao.save();
        BookService bookService =(BookService) ctx.getBean("bookService");
        bookService.save();

    }
}
